package oop.data;

import java.sql.SQLException;

import oop.db.dao.SectionStructureDAO;

public class CountConstraint {

	private long sectionStructureId;
	private int count;

	public void setCount(int count) {
		this.count = count;
	}

	public int getCount() {
		return count;
	}

	public CountConstraint(long sectionStructureId, int count) {
		this.sectionStructureId = sectionStructureId;
		this.count = count;
	}

	public SectionStructure getSectionStructure() {
		try {
			return SectionStructureDAO.fetchById(sectionStructureId).get(0);
		} catch (SQLException e) {
			throw new RuntimeException(e);
		}
	}
	
}
